package com.igs.parse;

import java.net.URL;
import org.apache.log4j.Logger;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

/**
 * 短信猫应用模块，下载最新消息
 * @author Administrator
 *
 */
public class DXM
{
	private static Logger log = Logger.getLogger(DXM.class);

	public static void main(String[] args)
	{
		try
		{
		String url="http://localhost:8080/igsweb/userinfo/gettodaydxmmsg?usercode=lzc&pwd=123456";
		Document doc = Jsoup.parse(new URL(url), 5000);
		Elements ullinklist = doc.getElementsByTag("ul");
		for (Element ul : ullinklist)
		{
			Elements ll = ul.getElementsByTag("li");
			String fullName=ll.get(0).text();
			System.out.println("用户名："+fullName);
			String phone=ll.get(1).text();
			System.out.println("手机号码："+phone);
			String count=ll.get(2).text();
			System.out.println("信息数量："+count);
			//发送短信消息
			System.out.println("发送短信消息...........................");

		}
		}catch(Exception ex)
		{
			log.error("获取每天短信猫消息失败！",ex);
		}
	}
}
